package router

import (
	ctrl "a-admin/web/controller"

	"github.com/gofiber/fiber/v2"
	"github.com/gofiber/fiber/v2/middleware/monitor"
)

func InitSysLoginRoutes(r fiber.Router) {
	server := ctrl.NewSysLoginController()
	{

		r.Get("/api/index/index", server.GetIndex)
		r.Get("/static/images/:filename", server.GetImg)
		r.Get("/admin/Index/login", server.CaptchaImage)
		r.Post("/admin/Index/login", server.Login)
		r.Get("/admin/Index/index", server.GetInfo)
		r.Get("/admin/Dashboard/index", server.GetDash)

		r.Get("/dashboard", monitor.New()) // 应用监控
		r.Post("/login", server.Login)
		r.Get("/captchaImage", server.CaptchaImage)
		r.Post("/logout", server.LoginOut)

		r.Get("/captchaVerify", server.CaptchaVerify)
		r.Get("/getEmailCode", server.GetEmailCode)
		r.Get("/emailCodeVerify", server.EmailCodeVerify)
		r.Post("/register", server.Register)

		r.Post("/refreshToken", server.RefreshToken)
	}
	rg := r.Group("/system")
	{
		rg.Get("/getInfo", server.GetInfo)
		rg.Get("/getRouters", server.GetRouters)
	}
}
